package com.kimastrom.theGame.View;

import android.graphics.PointF;

public class Input{

	public float mAccPosX;
	public float mAccPosY;
	public PointF mInput = new PointF(0, 0);
	
	public void setTouch(float aPosX, float aPosY,float aScreenWidth, float aScrenHeight) {
		if(mAccPosX == 0 && mAccPosY == 0) {
			mInput.set((aPosX / aScreenWidth - 0.5f) * 2.0f,(aPosY / aScreenWidth - 0.5f)); 
		}
	}
	
	public void setAccelermoter(float accPosX, float accPosY) {
		if(accPosX != 0 || accPosY != 0) {	
			mInput.set(accPosX / 10, accPosY / 10);
		}
	}
	
	public void update(float aTime) {
		mInput.set(mInput.x * 0.9f, mInput.y * 0.9f);
	}

}